#/bin/bash
# make README.txt from read_me.txt
# see http://www.grymoire.com/Unix/Sed.html
# see http://www.grymoire.com/Unix/Regular.html
# note that all single quotes are made rsquo
writeup -b -s text=true read_me.txt
sed -e 's%\(<h[^>]*\)\([^<]*\)%\1\U\2\E%g' \
    -e 's%\(<pstrong[^>]*\)\([^<]*\)%\1\U\2\E%g' \
    -e 's%<strong[^>]*>\([^<]*\)</strong>%\U\1\E%g' \
    -e 's%<em[^>]*>\([^<]*\)</em>%*\1\*%g' \
    -e 's%&#8216;%\x27%g' \
    -e 's%&#8217;%\x27%g' \
    -e 's%&#8220;%"%g' \
    -e 's%&#8221;%"%g' \
    -e 's%&#8212;%--%g' read_me.html > README.html
html2text -rcfile html2textrc -nobs -ascii -o README.txt README.html
rm README.html
cp -f README.txt ../d6
cp -f README.txt ../d7
#finally make web version
writeup read_me.txt

